home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / compugr.zip / COMPUPGR.PAS < prev    next >
Pascal/Delphi Source File  |  1992-08-20  |  2KB  |  73 lines

  1. {
  2. This was generated as something of a joke, so try to keep a sense of humor.
  3. One player noted that he had something "that detected a complex tree of 19
  4. sectors protected by a single sector".  Another person asked that "why
  5. doesn't somebody just write an offline utility called "the computer upgrade"
  6. so that we can at last answer yes and be done with it.  Here it is, guys...
  7. }
  8.  
  9. { I keep forgetting to turn off 286 instruction set.  So, better force it
  10.   off here, before I confuse any more 286 people. }
  11. {$A+}        { speed up us 80x86 guys }
  12. {$B-}        { I dig short circuits }
  13. {$I+}        { pisses people off when they hit a letter, but its better than
  14.                gigo. }
  15. {$G-}        { turn OFF 286 instruction set }
  16.  
  17.  
  18. program cut_point_analysis;
  19.  
  20. uses DOS;
  21.  
  22. {$I headers.inc}
  23.  
  24. type
  25.   sectorSet = array [ sector ] of boolean;
  26. var
  27.   BBSName   : string;
  28.   space     : TheVoid;
  29.   s, i      : sector;
  30.   basegraph,
  31.   subgraph  : sectorSet;
  32.   basecount,
  33.   access    : sectorindex;
  34.  
  35. {$I QUEUE.INC }
  36. {$I status.inc }
  37. {$I misc.inc }
  38. {$I PortStat.inc }
  39. {$I gsdata.inc }
  40. {$I subgraph.inc}
  41.  
  42. begin {main}
  43.   writeln('The Computer UPGRADE! : ', Version);
  44.   writeln( author );
  45.   writeln( source );
  46.   writeln;
  47.   InitSpace( Space );
  48.   if paramcount > 0 then
  49.     BBSName := paramstr( 1 )
  50.   else
  51.     BBSName := '';
  52.   GetData( space, BBSName, true );
  53.   for s := 1 to maxSector do
  54.     with space.sectors[s] do
  55.       etc := etc and (not Avoid);
  56.   basecount := achievable( space.sectors, 1, basegraph );
  57.   for s := 2 to maxSector do
  58.     begin
  59.       with space.sectors[s] do
  60.         etc := etc or Avoid;                            { mark inaccessible }
  61.       access := achievable( space.sectors, 1, subgraph);  { find connected  }
  62.       with space.sectors[s] do
  63.         etc := etc and (not Avoid);                  { mark available again }
  64.       if access < basecount then
  65.         begin
  66.           write('Sector ', s, ' protects ');
  67.           for i := 2 to maxSector do
  68.             if basegraph[i] and (not subgraph[ i ]) then write( i : 4, ' ');
  69.           writeln;
  70.         end; {if subgraph is proper}
  71.     end; {for s}
  72. end.
  73.